#

SRC=pd90-colour.c
BASE=$(shell pwd)
BUILD=$(BASE)/.build
OBJ=.build/$(SRC).hex

# Mega
MACH=arduino:avr:mega:cpu=atmega2560
PORT=/dev/ttyACM0
BAUD=115200
CPU=atmega2560
PROTO=stk500v2

HARD=/usr/share/arduino/hardware
TOOLS=/usr/share/arduino/tools

#

all:
	rm -rf .build; mkdir .build
	arduino-builder -hardware $(HARD) \
	-tools $(TOOLS) -fqbn $(MACH) \
	-build-path $(BUILD) -compile $(SRC)

upload:
	avrdude -D -V -F -C /etc/avrdude.conf -c $(PROTO) \
	-p $(CPU) -P $(PORT) -b $(BAUD) -U flash:w:$(OBJ)

clean:
	rm -rf $(BUILD)
	mkdir $(BUILD)

###
